<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="../../../common/include.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>添加用户</title>
<jsp:include page="../../../common/head.jsp"></jsp:include>
		<script language="javascript">
	        function update()
	        {
	        	var updPassword = $("#updPassword").attr("checked");
				var objarr = new Array(
					["userlist.password","原始密码","notEmpty",""],
					["newPassword","新密码","notEmpty",""],
					["newPassword","新密码","min","String:6"],
					["rePassword","新密码确认","notEmpty",""],
					["newPassword","两次输入密码不一致！","eqO","rePassword"]
				);
				if(updPassword!="checked"||xj.CheckAll(objarr))
				{
					if(window.confirm("确认修改？"))
					{
						if(updPassword!="checked")
						{
							document.frm.submit();
						}
						else
						{
							var tmp = parseInt(Math.random()*10000+1);
							var url = 'listCheckPasswordUser.do?userlist.userId=${sessionScope.sessionbean.userId}&userlist.password='+document.getElementById("userlist.password").value+'&tmp='+tmp;
							$.get(url, {},function (data, textStatus){
								if(data=="ok")
								{
									document.frm.submit();
								}
								else
								{
									alert("原始密码输入错误，请重新输入！");
								}
							});
						}
					}
				}
			}
			function showPassword()
			{
				var updPassword = $("#updPassword").attr("checked");
				_d(updPassword);
				if(updPassword=="checked")
					$("#pwd").css("display","");
				else
					$("#pwd").css("display","none");
			}
        </script>
	</head>

	<body>
		<form action="updateSettingUser.do" name="frm" id="frm" method="post">
		<div id="body_div">
	<w:ShowTitle name="修改用户设置">
	<w:TitleButton funcName="保存" onClickFunction="update()" urlImg="${ctx}/images/main/save.png"/>
	</w:ShowTitle>
	<div id="body_content">
			<table width="100%">
				<tr>
					<td width="100">
						用户ID
					</td>
					<td width="120" class="left_align">${sessionScope.sessionbean.userId}
						<input type="hidden" name="userlist.userId" value="${sessionScope.sessionbean.userId}"/>
					</td>
					<td width="100">
						用户名
					</td>
					<td class="left_align" width="120">
						${sessionScope.sessionbean.userName}
					</td>
					<td width="120">
					</td>
					<td class="left_align">
					</td>
				</tr>
				<tr>
					<td>
						修改密码
					</td>
					<td class="left_align">
					<input type="checkbox" name="updPassword" id="updPassword" value="yes" onchange="showPassword()"/>
					</td>
					<td>
					</td>
					<td class="left_align ">
					</td>
					<td>
					</td>
					<td class="left_align">
					</td>
				</tr>
				<tr id="pwd" style="display:none">
					<td>
						原密码
					</td>
					<td class="left_align">
						<input type="password" name="userlist.password" id="userlist.password" />
					</td>
					<td>
						输入新密码
					</td>
					<td class="left_align">
						<input type="password" name="newPassword" id="newPassword" />
					</td>
					<td>
						确认新密码
					</td>
					<td class="left_align">
						<input type="password" name="rePassword" />
					</td>
				</tr>
				<tr>
					<td>框架样式</td>
					<td class="left_align" colspan="5">
						菜单图标样式
						<w:radio name="icoStyle" styleClass="radio" value="ico_big" serverValue="${icoStyle}"/>大
						<w:radio name="icoStyle" styleClass="radio" value="ico_small" serverValue="${icoStyle}"/>小
						<br/>
						分标签显示页面
						<w:radio name="tabStyle" styleClass="radio" value="tabFrame_yes" serverValue="${tabStyle}"/>是
						<w:radio name="tabStyle" styleClass="radio" value="tabFrame_no" serverValue="${tabStyle}"/>否
					</td>
				</tr>
				<tr>
					<td colspan="6" class="left_align">注：框架样式调整后请重新登录系统后生效。</td>
					
				</tr>
			</table>
		</div>
		</div>
		</form>
	</body>
</html>
